<?php
/**
*
* Description
*
* @package	VirtueMart
* @subpackage
* @author
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: default.php 6461 2012-09-16 21:49:03Z Milbo $
*/

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::_( 'behavior.modal' );
//print_r($this->products['featured']);exit;
$products = $this->products['latest'];
?>
<section class="template">
    <a href="#" class="btn_scrolltop">Sroll to top</a>
    <div class="container">
        <div class="breadcrumb clearfix">
            {module Breadcrumbs}
        </div>
        <div class="contentSP clearfix">
            <div class="w_cate">
                <div class="cate" id="cssmenu">
                    <h4>Doanh mục sản phẩm</h4>
                    {module Menu category 2}
                </div>
            </div>
            <div class="main_right">
                <!--<div class="sanphamTB clearfix">
                    <div class="list_sp">
                    	<?php foreach ($this->categories as $category) {
							$caturl = JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id=' . $category->virtuemart_category_id);
						?>
                        <article>
                            <a href="<?php echo $caturl?>" class="animated">
                                <img src="<?php echo JURI::base().'thumbnail/timthumb.php?src='.$category->file_url.'&q=100&w=100&h=66'; ?>" />
                                <span><?php echo $category->category_name;?></span>
                            </a>
                        </article>
                        <?php }?>
                    </div>
                </div>-->
                <?php /*?><div class="thuonghieu clearfix">
                    <h2 style="margin-top:0px;">Thương hiệu</h2>
                    {module Manufacturer}
                </div><?php */?>
                <div class="spMoi clearfix">
                    <h2 style="margin-top:0px;">SẢN PHẨM MỚI</h2>
                    <ul class="listSP">
                    	<?php foreach($products as $product){
                            if($product->file_url_thumb){
								$image = $product->file_url;
							} else {
								$image = JURI::base().'images/no_image.jpg';
							}
                        ?>
                        <li>
                            <a href="<?php echo $product->link;?>">
                                <img src="<?php echo JURI::base().'thumbnail/timthumb.php?src='.$image.'&q=100&w=161&h=165'; ?>" />
                                <p><?php echo $product->mf_name;?> - <?php echo $product->product_name;?></p>
                                <p class="code">Mã: <?php echo $product->product_sku;?></p>
                                <p class="price"><?php if($product->prices['salesPrice']) echo number_format($product->prices['salesPrice'],0,'','.').' đ'; else echo "Liên hệ";?></p>
                                <span class="icon_new"></span>
                            </a>
                        </li>
                        <?php }?>
                    </ul>
                </div>
            </div>
        </div>
    </div>
</section>